﻿@using winproject.Models;
@{
    ViewBag.Title = "Product - Properties | Software-Kart.com";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";

    int resCode = 0;
    ProductProperties oItemEditDetail = null;
    if (ViewData != null && ViewData.Keys.Count() > 0 && ViewData.Keys.Contains("resCode"))
    {
        resCode = Convert.ToInt32(ViewData["resCode"]);
    }
    if (resCode == 250)
    {
        oItemEditDetail = (ProductProperties)ViewData["resData"];
    }
    
}

@Styles.Render("~/Content/Vendors")
<link type="text/css" rel="stylesheet" href="~/Content/css/jquery-te-1.4.0.css">
<script type="text/javascript" src="~/Scripts/jquery-te-1.4.0.js" charset="utf-8"></script>
@Html.Partial("_LeftMenu")


<!-- content -->
<div class="col-md-10">
    
    <div class="row">
        <div class="panel panel-default bootstrap-admin-no-table-panel">
            <div class="row">
                <div class="col-md-9 text-left">
                    <ol class="breadcrumb">
                      <li><a href="#">Category</a></li>
                      <li><a href="#">Subcategory</a></li>
                      <li class="active">Product: Title</li>
                    </ol> 
                </div>
            </div>
            <div class="panel-heading">
                <div class="text-muted bootstrap-admin-box-title">Product > Properties</div>
            </div>
            <div class="bootstrap-admin-no-table-panel-content bootstrap-admin-panel-content collapse in">
                <form id="frmProdProperties" action="~/Products/AddProductProperty"  method="post" enctype="multipart/form-data" >
                    @{
                        if (oItemEditDetail != null && (oItemEditDetail.nPid) > 0)
                        {
                            <input type="hidden" id="txtUniqueId" name="txtUniqueId" value="@oItemEditDetail.nPid" />
                        }
                          else{
                            <input type="hidden" id="txtUniqueId" name="txtUniqueId" value="@ViewData["pid"]" />   
                          }
                     }
                <table width="100%"  cellpadding="5" class="table-striped">
                    <tr>
                        <td style="width:200px;vertical-align:top">
                            Enter TOC Link
                        </td>
                        <td style="width:20px;vertical-align:top">:</td>
                        <td>
                            @{
                                if (oItemEditDetail != null && !string.IsNullOrEmpty(oItemEditDetail.sTocLink))
                                {
                                    <input type="text" id="txtTocLink" name="txtTocLink" value="@oItemEditDetail.sTocLink.Trim()"/>
                                }
                                else
                                {
                                    <input type="text" id="txtTocLink" name="txtTocLink" />
                                }
                            }
                        </td>
                    </tr>
                    <tr>
                        <td style="width:200px;vertical-align:top">
                            Enter Eula Link
                        </td>
                        <td style="width:20px;vertical-align:top">:</td>
                        <td>
                            @{
                                if (oItemEditDetail != null && !string.IsNullOrEmpty(oItemEditDetail.sEulaLink))
                                {
                                    <input type="text" id="txtEulaLink" name="txtEulaLink" value="@oItemEditDetail.sEulaLink.Trim()"/>
                                }
                                else
                                {
                                    <input type="text" id="txtEulaLink" name="txtEulaLink" />
                                }
                            }
                        </td>
                    </tr>
                    <tr>
                        <td style="width:200px;vertical-align:top">
                            Enter Exe-Name
                        </td>
                        <td style="width:20px;vertical-align:top">:</td>
                        <td>
                            @{
                                if (oItemEditDetail != null && !string.IsNullOrEmpty(oItemEditDetail.sExeName))
                                {
                                    <input type="text" id="txtExeName" name="txtExeName" value="@oItemEditDetail.sExeName.Trim()"/>
                                }
                                else
                                {
                                    <input type="text" id="txtExeName" name="txtExeName" />
                                }
                            }
                        </td>
                    </tr>
                    <tr>
                        <td style="width:200px;vertical-align:top">
                            Enter MD5CheckSum
                        </td>
                        <td style="width:20px;vertical-align:top">:</td>
                        <td>
                            @{
                                if (oItemEditDetail != null && !string.IsNullOrEmpty(oItemEditDetail.sMD5CheckSum))
                                {
                                    <input type="text" id="txtMD5CheckSum" name="txtMD5CheckSum" value="@oItemEditDetail.sMD5CheckSum.Trim()"/>
                                }
                                else
                                {
                                    <input type="text" id="txtMD5CheckSum" name="txtMD5CheckSum" />
                                }
                            }
                        </td>
                    </tr>
                    <tr>
                        <td style="width:200px;vertical-align:top">
                            Enter File Size(bytes)
                        </td>
                        <td style="width:20px;vertical-align:top">:</td>
                        <td>
                            @{
                                if (oItemEditDetail != null && (oItemEditDetail.nSizeInBytes)>0)
                                {
                                    <input type="text" id="txtFilesSize" name="txtFilesSize" value="@oItemEditDetail.nSizeInBytes" />
                                }
                                else
                                {
                                    <input type="text" id="txtFilesSize" name="txtFilesSize" />
                                }
                            }
                        </td>
                    </tr>
                    <tr>
                        <td style="width:200px;vertical-align:top">
                            Enter Author Name
                        </td>
                        <td style="width:20px;vertical-align:top">:</td>
                        <td>
                            @{
                                if (oItemEditDetail != null && !string.IsNullOrEmpty(oItemEditDetail.sAuthorName))
                                {
                                    <input type="text" id="txtAuthorName" name="txtAuthorName" value="@oItemEditDetail.sAuthorName.Trim()" />
                                }
                                else
                                {
                                    <input type="text" id="txtAuthorName" name="txtAuthorName" />
                                }
                            }
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <table>
                                <tr>
                                    <td>
                                        Digital Signed
                                    </td>
                                    <td>
                                        @{
                                            if (oItemEditDetail != null && (oItemEditDetail._isDigitalSigned==true))
                                            {
                                                <input type="checkbox" id="chkExeSigned" name="chkExeSigned" checked="checked"/>
                                            }
                                            else
                                            {
                                                <input type="checkbox" id="chkExeSigned" name="chkExeSigned" />
                                            }
                                        }
                                        
                                    </td>
                                    <td>
                                        Multilingual
                                    </td>
                                    <td>
                                        @{
                                            if (oItemEditDetail != null && (oItemEditDetail._isMultilingual==true))
                                            {
                                                <input type="checkbox" id="chkMultilingual" name="chkMultilingual" checked="checked"/>
                                            }
                                            else
                                            {
                                                <input type="checkbox" id="chkMultilingual" name="chkMultilingual" />
                                            }
                                        }
                                        
                                    </td>
                                </tr>
                            </table>

                        </td>
                        
                    </tr>
                    

                    <tr>
                        <td colspan="2">
                            &nbsp;
                        </td>
                        <td class="text-left">
                            @{
                                if (oItemEditDetail != null && (oItemEditDetail.nPid) > 0)
                                {
                                    <button type="submit" id="cmdSave" name="cmdSave" value="Save">Save</button>
                                }
                                else
                                {
                                    <button type="submit" id="cmdSave" name="cmdSave" value="Add">Add</button>
                                }
                            }
                            &nbsp; &nbsp;
                            <button type="button" id="cmdCancel" name="cmdSave" value="Cancel" onclick="window.location.href='@HttpContext.Current.Request.ApplicationPath/Admin/SubCategory'">Cancel</button>
                        </td>
                    </tr>
                </table>
                </form>
            </div>
        </div>
    </div>
    
</div>


<script>
    //Declarations
    var itemGridListGlobal = [];

    function ProductProperties() {
        this.nPid =0;
        this.sTocLink ="";
        this.sEulaLink ="";
        this.sExeName ="";
        this.nSizeInBytes =0;
        this.sMD5CheckSum ="";
        this.sAuthorName ="";
        this._isDigitalSigned =false;
        this._isMultilingual =false;
    }

    function editItem(itemid) {
        if (!isNaN(itemid) && parseInt(itemid) > 0) {
            $("#txtUniqueId").val(itemid);
            $("#frmProdProperties").attr("action", approotpath + "Products/ProductProperties");
            $("#frmProdProperties").submit();
        }
    }
    //getVirusDetail():: fetches virus details
    function getCatSubCatProdName(pid) {
        $.ajax(approotpath + "Products/GetProductBreadCrumb", {
            data: {},
            type: "GET",
            dataType: 'json',
            success: function (data) {
                var dataJson = $.parseJSON(data.msgJson);
                alert("GetProductBreadCrumb");
            }
        });
    }
</script>

